package org.insia.smartposse.config;

import org.insia.smartposse.dao.CategoryDAO;
import org.insia.smartposse.dao.CategoryThemeDAO;
import org.insia.smartposse.dao.CompanyDAO;
import org.insia.smartposse.dao.FreelanceAlertDAO;
import org.insia.smartposse.dao.FreelanceDAO;
import org.insia.smartposse.dao.FreelancePortfolioDAO;
import org.insia.smartposse.dao.FreelanceSkillDAO;
import org.insia.smartposse.dao.MessagerieDAO;
import org.insia.smartposse.dao.ProjectDAO;
import org.insia.smartposse.dao.ProjectSkillAffectationDAO;
import org.insia.smartposse.dao.ProjectSkillDAO;
import org.insia.smartposse.dao.SkillCategoryDAO;
import org.insia.smartposse.dao.SkillDAO;
import org.insia.smartposse.dao.UserDAO;
import org.insia.smartposse.idao.ICategoryDAO;
import org.insia.smartposse.idao.ICategoryThemeDAO;
import org.insia.smartposse.idao.ICompanyDAO;
import org.insia.smartposse.idao.IFreelanceAlertDAO;
import org.insia.smartposse.idao.IFreelanceDAO;
import org.insia.smartposse.idao.IFreelancePortfolioDAO;
import org.insia.smartposse.idao.IFreelanceSkillDAO;
import org.insia.smartposse.idao.IMessagerieDAO;
import org.insia.smartposse.idao.IProjectDAO;
import org.insia.smartposse.idao.IProjectSkillAffectationDAO;
import org.insia.smartposse.idao.IProjectSkillDAO;
import org.insia.smartposse.idao.ISkillCategoryDAO;
import org.insia.smartposse.idao.ISkillDAO;
import org.insia.smartposse.idao.IUserDAO;

/**
 * DAO Facory to avoid multiple instance of DAO classes.
 * @author sok hout
 *
 */
public class DAOFactory {
	private static ICompanyDAO _companyDAO = new CompanyDAO();
	private static IFreelanceAlertDAO _freelanceAlertDAO = new FreelanceAlertDAO();
	private static IFreelanceDAO _freelanceDAO = new FreelanceDAO();
	private static IFreelancePortfolioDAO _freelancePortfolioDAO = new FreelancePortfolioDAO();
	private static IFreelanceSkillDAO _freelanceSkillDAO = new FreelanceSkillDAO();
	private static IMessagerieDAO _messagerieDAO = new MessagerieDAO();
	private static ICategoryDAO _categoryDAO = new CategoryDAO();
	private static ICategoryThemeDAO _categoryThemeDAO = new CategoryThemeDAO();
	private static IProjectDAO _projectDAO = new ProjectDAO();
	private static IProjectSkillAffectationDAO _projectSkillAffectationDAO = new ProjectSkillAffectationDAO();
	private static IProjectSkillDAO _projectSkillDAO = new ProjectSkillDAO();
	private static ISkillCategoryDAO _skillCategoryDAO = new SkillCategoryDAO();
	private static ISkillDAO _skillDAO = new SkillDAO();
	private static IUserDAO _userDAO = new UserDAO();
	
	/**
	 * Empty contructor
	 *
	 */
	private DAOFactory() {
	}

	/**
	 * @return
	 */
	public static ICompanyDAO getCompanyDAO() {
		return _companyDAO;
	}

	/**
	 * @param companyDAO
	 */
	public static void setCompanyDAO(ICompanyDAO companyDAO) {
		DAOFactory._companyDAO = companyDAO;
	}

	/**
	 * @return
	 */
	public static IFreelanceAlertDAO getFreelanceAlertDAO() {
		return _freelanceAlertDAO;
	}

	/**
	 * @param freelanceAlertDAO
	 */
	public static void setFreelanceAlertDAO(IFreelanceAlertDAO freelanceAlertDAO) {
		DAOFactory._freelanceAlertDAO = freelanceAlertDAO;
	}

	
	/**
	 * @return
	 */
	public static IFreelanceDAO getFreelanceDAO() {
		return _freelanceDAO;
	}

	/**
	 * @param freelanceDAO
	 */
	public static void setFreelanceDAO(IFreelanceDAO freelanceDAO) {
		DAOFactory._freelanceDAO = freelanceDAO;
	}

	/**
	 * @return
	 */
	public static IFreelancePortfolioDAO getFreelancePortfolioDAO() {
		return _freelancePortfolioDAO;
	}

	/**
	 * @param freelancePortfolioDAO
	 */
	public static void setFreelancePortfolioDAO(
			IFreelancePortfolioDAO freelancePortfolioDAO) {
		DAOFactory._freelancePortfolioDAO = freelancePortfolioDAO;
	}

	/**
	 * @return
	 */
	public static IFreelanceSkillDAO getFreelanceSkillDAO() {
		return _freelanceSkillDAO;
	}

	/**
	 * @param freelanceSkillDAO
	 */
	public static void setFreelanceSkillDAO(IFreelanceSkillDAO freelanceSkillDAO) {
		DAOFactory._freelanceSkillDAO = freelanceSkillDAO;
	}

	/**
	 * @return
	 */
	public static IMessagerieDAO getMessagerieDAO() {
		return _messagerieDAO;
	}

	/**
	 * @param messagerieDAO
	 */
	public static void setMessagerieDAO(IMessagerieDAO messagerieDAO) {
		DAOFactory._messagerieDAO = messagerieDAO;
	}

	/**
	 * @return
	 */
	public static ICategoryDAO getCategoryDAO() {
		return _categoryDAO;
	}

	/**
	 * @param projectCategoryDAO
	 */
	public static void setCategoryDAO(ICategoryDAO categoryDAO) {
		DAOFactory._categoryDAO = categoryDAO;
	}

	/**
	 * @return
	 */
	public static ICategoryThemeDAO getCategoryThemeDAO() {
		return _categoryThemeDAO;
	}

	/**
	 * @param projectCategoryThemeDAO
	 */
	public static void setCategoryThemeDAO(
			ICategoryThemeDAO categoryThemeDAO) {
		DAOFactory._categoryThemeDAO = categoryThemeDAO;
	}

	/**
	 * @return
	 */
	public static IProjectDAO getProjectDAO() {
		return _projectDAO;
	}

	/**
	 * @param projectDAO
	 */
	public static void setProjectDAO(IProjectDAO projectDAO) {
		DAOFactory._projectDAO = projectDAO;
	}

	/**
	 * @return
	 */
	public static IProjectSkillAffectationDAO getProjectSkillAffectationDAO() {
		return _projectSkillAffectationDAO;
	}

	/**
	 * @param projectSkillAffectationDAO
	 */
	public static void setProjectSkillAffectationDAO(
			IProjectSkillAffectationDAO projectSkillAffectationDAO) {
		DAOFactory._projectSkillAffectationDAO = projectSkillAffectationDAO;
	}

	/**
	 * @return
	 */
	public static IProjectSkillDAO getProjectSkillDAO() {
		return _projectSkillDAO;
	}

	/**
	 * @param projectSkillDAO
	 */
	public static void setProjectSkillDAO(IProjectSkillDAO projectSkillDAO) {
		DAOFactory._projectSkillDAO = projectSkillDAO;
	}

	/**
	 * @return
	 */
	public static ISkillCategoryDAO getSkillCategoryDAO() {
		return _skillCategoryDAO;
	}

	/**
	 * @param skillCategoryDAO
	 */
	public static void setSkillCategoryDAO(ISkillCategoryDAO skillCategoryDAO) {
		DAOFactory._skillCategoryDAO = skillCategoryDAO;
	}

	/**
	 * @return
	 */
	public static ISkillDAO getSkillDAO() {
		return _skillDAO;
	}

	/**
	 * @param skillDAO
	 */
	public static void setSkillDAO(ISkillDAO skillDAO) {
		DAOFactory._skillDAO = skillDAO;
	}

	/**
	 * @return
	 */
	public static IUserDAO getUserDAO() {
		return _userDAO;
	}

	/**
	 * @param userDAO
	 */
	public static void setUserDAO(IUserDAO userDAO) {
		DAOFactory._userDAO = userDAO;
	}
}
